package com.mobile.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.yspa.manual.service.ChildManualManager;
import com.yspa.yspa.service.YspaInterfaceManager;
/**
 *
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/mobile/yspaInterface")
public class MobileYspaInterfaceController {

	@Autowired
	private HttpServletRequest request;
	
	@Autowired
	private YspaInterfaceManager manager;
	
	@Autowired
	private ChildManualManager childManualManager;
	
	/**
	 * 跳向活动公告列表页面
	 * @return
	 */
	@RequestMapping("/hactivityList")
	public String toSchedulePage(HttpServletRequest request){
		return "/mobile/hactivityList";
	}
	
	/**
	 * 跳向活动公告详情页面
	 * @return
	 */
	@RequestMapping("/showHactivity")
	public String showHactivity(){
		String hactivityId = request.getParameter("hactivityId");
		Map<String, Object> hactivityMap = manager.getHactivityInfo(Long.parseLong(hactivityId));
		request.setAttribute("hactivityMap", hactivityMap);
		return "/mobile/hactivityShow";
	}
	
	/**
	 * 跳向健康叮咛列表页面
	 * @return
	 */
	@RequestMapping("/calendarlogList")
	public String calendarlogList(){
		return "/mobile/calendarlogList";
	}
	
	/**
	 * 健康叮咛详情
	 * @return
	 */
	@RequestMapping("/calendarlogShow")
	public String calendarlogShow(){
		String id = request.getParameter("calendarlogId");
		Map<String, Object> calendarlogMap = manager.getCalendarlogInfo(Integer.parseInt(id));
		request.setAttribute("calendarlogMap", calendarlogMap);
		return "/mobile/calendarlogShow";
	}
	
	/**
	 * 跳向用药提醒列表页面
	 * @return
	 */
	@RequestMapping("/hpMedicineSugList")
	public String hpMedicineSugList(){
		return "/mobile/hpMedicineSugList";
	}
	
	/**
	 * 跳向健康排程列表页面
	 * @return
	 */
	@RequestMapping("/healthScheduleList")
	public String healthScheduleList(){
		return "/mobile/healthScheduleList";
	}
	
	/**
	 * 跳向预约行程列表页面
	 * @return
	 */
	@RequestMapping("/hpProEventList")
	public String hpProEventList(){
		return "/mobile/hpProEventList";
	}
	
	/**
	 * 预约行程详情
	 * @return
	 */
	@RequestMapping("/hpProEventShow")
	public String hpProEventShow(){
		String id = request.getParameter("hpProEventId");
		Map<String, Object> hpProEventMap = manager.getHPProEventInfo(Integer.parseInt(id));
		request.setAttribute("hpProEventMap", hpProEventMap);
		return "/mobile/hpProEventShow";
	}
	
	/**
	 * 跳向血压查询列表页面
	 * @return
	 */
	@RequestMapping("/measemp01List")
	public String measemp01List(){
		return "/mobile/measemp01List";
	}
	
	/**
	 * 跳向血糖查询列表页面
	 * @return
	 */
	@RequestMapping("/measemp02List")
	public String measemp02List(){
		return "/mobile/measemp02List";
	}
	
	/**
	 * 跳向体脂查询列表页面
	 * @return
	 */
	@RequestMapping("/measemp06List")
	public String measemp06List(){
		return "/mobile/measemp06List";
	}
	
	/**
	 * 健康知识家
	 * @return
	 */
	@RequestMapping("/hpKnowledgeList")
	public String hpKnowledgeList(){
		return "/mobile/hpKnowledgeList";
	}
	
	/**
	 * 健康知识家详情
	 * @return
	 */
	@RequestMapping("/showHPKnowledge")
	public String showHPKnowledge(){
		String hpKnowledgeId = request.getParameter("hpKnowledgeId");
		Map<String, Object> hpKnowledgeMap = manager.getHPKnowledgeInfo(Integer.parseInt(hpKnowledgeId), null);
		request.setAttribute("hpKnowledgeMap", hpKnowledgeMap);
		return "/mobile/hpKnowledgeShow";
	}
	
	/**
	 * 食物卡卡
	 * @return
	 */
	@RequestMapping("/foodclassList")
	public String foodclassList(){
		return "/mobile/foodclassList";
	}
	
	/**
	 * 食物卡路里
	 * @return
	 */
	@RequestMapping("/foodcalorList")
	public String foodcalorList(){
		request.setAttribute("classcd", request.getParameter("classcd"));
		request.setAttribute("searchName", request.getParameter("searchName"));
		return "/mobile/foodcalorList";
	}
	
	/**
	 * 健康手册
	 * @return
	 */
	@RequestMapping("/childManualList")
	public String childManualList(){
		request.setAttribute("mtype", request.getParameter("mtype"));
		return "/mobile/childManualList";
	}
	
	@RequestMapping("/childManualShow")
	public String showChildManual(){
		String id = request.getParameter("childManualId");
		Map<String, Object> childManualMap = childManualManager.getEditInfo(id);
		request.setAttribute("childManualMap", childManualMap);
		return "/mobile/childManualShow";
	}
	
}
